Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@lion/localize
Advanced tools
The localization system helps to manage localization data split into locales and automate its loading
Is meant to translate text into multiple languages. In it's simplest form it is a function that returns the translated text for a namespace + key.
Further examples and a more in depth description can be found at the Use Cases Page.
Feature | Description |
---|---|
Translate Text | Load and translate text in multiple languages |
Format Numbers | Format numbers in multiple languages |
Format Dates | Format dates in multiple languages |
npm i --save @lion/localize
import { localize } from '@lion/localize';
The locale which will be loaded by default is accessed via the localize.locale
.
The single source of truth for page's locale is <html lang="my-LOCALE">
.
At the same time the interaction should happen via localize.locale
getter/setter to be able to notify and react to the change.
import { localize } from '@lion/localize.js';
localize.addEventListener('localeChanged', () => {
// do smth when data is loaded for a new locale
});
// changes locale, syncs to `<html lang="es-ES">` and fires the event above
localize.locale = 'es-ES';
FAQs
The localization system helps to manage localization data split into locales and automate its loading
The npm package @lion/localize receives a total of 2,161 weekly downloads. As such, @lion/localize popularity was classified as popular.
We found that @lion/localize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.